package com.wfh.picture.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wfh.picture.api.aliyunai.model.CreateOutPaintingTaskResponse;
import com.wfh.picture.common.DeleteRequest;
import com.wfh.picture.model.dto.picture.*;
import com.wfh.picture.model.entity.Picture;
import com.wfh.picture.model.entity.User;
import com.wfh.picture.model.vo.PictureVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author lenovo
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-05-09 14:00:51
*/
public interface PictureService extends IService<Picture> {

    /**
     * 上传图片
     * @param inputSource
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            User loginUser);

    PictureVO getPictureVO(Picture picture, HttpServletRequest request);

    void validPicture(Picture picture);

    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    /**
     * 获取查询条件
     * @param pictureQueryRequest
     * @return
     */
    LambdaQueryWrapper<Picture> getQueryWrapper (PictureQueryRequest pictureQueryRequest);

    /**
     * 图片审核请求
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPicture (PictureReviewRequest pictureReviewRequest, User loginUser);

    /**
     * 填充图片参数
     * @param picture
     * @param loginUser
     */
    void fillReviewParams(Picture picture, User loginUser);

    /**
     * 批量抓取和创建图片
     * @param loginUser
     * @param pictureUploadByBatchRequest
     * @return
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);

    /**
     * 清理图片
     * @param picture
     */
    void clearPicture(Picture picture);

    void deletePicture(DeleteRequest deleteRequest, HttpServletRequest request);

    /**
     * 校验图片权限
     * @param picture
     * @param loginUser
     */
    void checkPictureAuth(Picture picture, User loginUser);

    /**
     * 根据图片颜色搜索
     * @param spaceId
     * @param picColor
     * @param loginUser
     */
    List<PictureVO> searchPictureByColor(Long spaceId, String picColor, User loginUser);

    /**
     * 批量编辑图片
     * @param pictureEditByBatchRequest
     * @param loginUser
     */
    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);

    /**
     * 创建扩展任务
     * @param createPictureOutPaintingTaskRequest
     * @param loginUser
     */
    CreateOutPaintingTaskResponse createPictureExpandTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User loginUser);
}
